#!/usr/bin/env python
# -*- coding: UTF-8 -*-

# videochat_window.py 
#
#  Copyright (c) 2006 INdT (Instituto Nokia de Technologia)
#
#  Author: Kenneth Rohde Christiansen <kenneth.christiansen@gmail.com>
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License as
#  published by the Free Software Foundation; either version 2 of the
#  License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
#  USA

import pygtk
pygtk.require("2.0")
import gtk
import gobject
import icon_theme

class VideoChatWindow(gobject.GObject):

    def __init__(self, id, local_contact_store=None):
        self.local_contact_store = local_contact_store

        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.set_title("%s - Video Chat" % local_contact_store.get_alias(id))
        self.window.set_icon_name("camera-web")
        self.window.set_size_request(350, 300)

        self.vbox1 = gtk.VBox(False, 0)
        self.vbox1.set_border_width(3)
        self.window.add(self.vbox1)

        self.vbox2 = gtk.VBox(False, 0)

        self.vbox1.pack_start(self.vbox2, True, True, 0)

        self.alignment1 = gtk.Alignment(0.5, 0.5, 1, 1)
        self.vbox2.pack_start(self.alignment1, True, True, 0)
        self.alignment1.set_border_width(3)
        self.event_box = gtk.EventBox()
        self.event_box.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(65535, 65535, 65535))
        self.alignment1.add(self.event_box)
        self.conn_label = gtk.Label()
        self.conn_label.set_markup("<b>Connecting...</b>")
        self.event_box.add(self.conn_label)

        self.hbox2 = gtk.HBox(False, 0)
        self.hbox2.set_spacing(4)

        self.vbox2.pack_start(gtk.HSeparator(), False, True, 0)
        self.vbox2.pack_start(self.hbox2, False, True, 0)

        self.button_mute = gtk.Button()
        pixbuf_mute = icon_theme.icon_theme_get_default().\
                load_icon('audio-volume-muted', 24, 0)
        image_mute = gtk.Image()
        image_mute.set_from_pixbuf(pixbuf_mute)
        self.button_mute.add(image_mute)
        self.button_mute.connect('clicked', self.on_button_mute_clicked)

        self.button_ownpic = gtk.Button()
        pixbuf_ownpic = icon_theme.icon_theme_get_default().\
                load_icon('audio-volume-muted', 24, 0)
        image_ownpic = gtk.Image()
        image_ownpic.set_from_pixbuf(pixbuf_ownpic)
        self.button_ownpic.add(image_ownpic)
        self.button_ownpic.connect('clicked', self.on_button_ownpic_clicked)

        self.button_prefs = gtk.Button()
        pixbuf_prefs = icon_theme.icon_theme_get_default().\
                load_icon('gtk-properties', 24, 0)
        image_prefs = gtk.Image()
        image_prefs.set_from_pixbuf(pixbuf_prefs)
        self.button_prefs.add(image_prefs)
        self.button_prefs.connect('clicked', self.on_button_prefs_clicked)

        self.hbox2.pack_end(self.button_ownpic, False, False, 0)
        self.hbox2.pack_end(self.button_mute, False, False, 0)

        self.hbox1 = gtk.HBox(False, 0)
        self.vbox1.pack_start(self.hbox1, False, False, 0)

        self.hbuttonbox1 = gtk.HButtonBox()
        self.vbox1.pack_start(self.hbuttonbox1, False, True, 0)

        self.window.show_all()


    def on_button_mute_clicked(self, widget):
        print 'mute'

    def on_button_ownpic_clicked(self, widget):
        print 'ownpic'

    def on_button_prefs_clicked(self, widget):
        print 'prefs'

